package com.cta.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "cta_pbx")
public class PBX implements BaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "cta_pbx_seq")
	@SequenceGenerator(name = "cta_pbx_seq", sequenceName = "cta_pbx_seq")
	@Column(name = "id", unique = true, nullable = false)
	private Long id;

	@Column(name = "name", unique = true, nullable = false)
	private String name;

	@Column(name = "description")
	private String description;

	@Column(name = "assign_to")
	private Long assignTo;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pbx_factory_id")
	private PBXFactory pbxFactory;

	public PBX() {
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Long getAssignTo() {
		return assignTo;
	}

	public void setAssignTo(Long assignTo) {
		this.assignTo = assignTo;
	}

	public PBXFactory getPbxFactory() {
		return pbxFactory;
	}

	public void setPbxFactory(PBXFactory pbxFactory) {
		this.pbxFactory = pbxFactory;
	}

}
